package btanalyzer.db.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotNull;

@Entity
@Table(name="METADATA_ANNOUNCE_URL", uniqueConstraints = {
		@UniqueConstraint(columnNames = {"ANNOUNCE_URL_ID", "METADATA_ID"})})
public class MetadataAnnounceUrl {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq")
	@SequenceGenerator(name="seq", sequenceName="METADATA_ANNOUNCE_URL_SEQ")
	@Column(name="METADATA_ANNOUNCE_URL_ID")
	private Long id;
	public void setId(Long id) {
		this.id = id;
	}
	public Long getId() {
		return id;
	}
	
	@NotNull
	@Column(name="ORDER_NUMBER")
    private Integer orderNumber;
	public void setOrderNumber(Integer orderNumber) {
		this.orderNumber = orderNumber;
	}
	public Integer getOrderNumber() {
		return orderNumber;
	}
	
	
	@NotNull
	@ManyToOne
	@JoinColumn(name = "ANNOUNCE_URL_ID")
	AnnounceUrl announceUrl;
	public void setAnnounceUrl(AnnounceUrl announceUrl) {
		this.announceUrl = announceUrl;
	}
	public AnnounceUrl getAnnounceUrl() {
		return announceUrl;
	}
	
	@NotNull
	@ManyToOne
	@JoinColumn(name = "METADATA_ID")
	Metadata metadata;
	public void setMetadata(Metadata metadata) {
		this.metadata = metadata;
	}
	public Metadata getMetadata() {
		return metadata;
	}
}
